package com.rightsidetech.commom.enums;

import com.rightsidetech.commom.utils.StringUtil;

/**
 * @Author: yhr
 * @Date: 2021-11-11 10:43
 * @Description: 系统参数KEY常量
 */
public enum SystemParamsEnum {
    /**
     * 系统参数KEY常量
     */
    ALERT_CARGO("电池商品预警值","ALERT_CARGO"),
    INTEGRAL_MONEY("卖出1积分商品对应金额","INTEGRAL_MONEY"),
    REFUND_TIME("电池商城申请退款时间","REFUND_TIME"),
    WORK_TIME("门店上班时间","STORE_WORK_TIME"),
    BATTERY_TIME_OUT("电池过期提醒时间","BATTERY_TIME_OUT"),
    MAX_SCOPE("最远服务范围(公里)","MAX_SCOPE"),
    STORE_USE_SCOPE("门店上门服务范围(公里)","STORE_USE_SCOPE")
    ;


    private String describe;
    private String value;

    SystemParamsEnum(String describe, String value ) {
        this.describe= describe;
        this.value= value;
    }

    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }
    public static SystemParamsEnum parse(String value) {
        if (StringUtil.isNullorEmpty(value)) {
            return null;
        }
        SystemParamsEnum rtype = null;
        for (SystemParamsEnum type : SystemParamsEnum.values()) {
            if (type.getValue().equals(value)) {
                rtype = type;
            }
        }
        return rtype;
    }
}
